import axios from '../utils/axios'

export const api=(method,model,resource,obj,option='')=>{
	method=='get'?obj={params:obj}:method=='delete'?obj={data:obj}:'';
	if(resource==-1) return axios[method](`/${model}`,obj);
	return axios[method](`/${model}/${resource}/${option}`,obj);
};

//生成短网址
export const generateUrl=(url)=>{
														// suoims
	return axios.get(`https://api.uomg.com/api/long2dwz?dwzapi=mrwso&url=${url}`);
}
